<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
  function calc (arr1, arr2) {
    let set1 = new Set(arr1);
    let set2 = new Set(arr2);

    let subset = [];

    for (let item of set1) {
      if (!set2.has(item)) {
        subset.push(item);
      }
    }

    return subset;
  };


  const x = [
    "前向碰撞报警",
    "车道偏离报警",
    "车距过近报警",
    "行人碰撞报警",
    "频繁变道报警",
    "道路标识超限报警",
    "障碍物报警 ",
    "疲劳驾驶报警",
    "接打电话报警",
    "抽烟报警",
    "分神驾驶报警",
    "驾驶员异常报警",
    "驾驶员分神驾驶报警"
  ]

  const y = [
    "疲劳驾驶报警",
    "接打电话报警",
    "抽烟报警",
    "分神驾驶报警",
    "驾驶员异常报警",
    "驾驶员分神驾驶报警"
  ]

  console.log(calc(x,y))
</script>
</body>
</html>
